package com.example.service.impl;

import com.example.entity.Img;
import com.example.mapper.ImgMapper;
import com.example.service.ImgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(rollbackFor = Exception.class)
public class ImgServiceImpl implements ImgService {

    @Autowired
    ImgMapper imgMapper;

    @Override
    public int insert(Img img) {
        imgMapper.insert(img);
        return img.getImgid();
    }
}
